home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-09 | 2.1 KB | 62 lines | [TEXT/GEOL] |
- Item 2003169 9-Oct-89 08:34
-
- From: REDDEN Peat Marwick, Kevin Redden,VCA
-
- To: MADA.EUROPE MacApp Dev Assoc Europe, E Carrasco
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: RE - Printing several views
-
- Father Vincent,
-
- On the last project I worked on I had to implement something very similar to
- what you are trying to do. The view was also a spreadsheet based on the CALC
- example and I ran in to the same problems with printing. Like the CALC example
- I had a row titles view, column titles view, and a main cells view ( each
- having their own scrollers ) and each printed page had to contain the
- corresponding parts of each ( as well as a page header ).
-
- The way I implemented it was as follows:
-
- I gave the row and column title views their own decendants of TStdPrintHandler
- ( overriding only BreakFollowing ) and made each of these fields within the
- printhandler for the main Cells view.
-
- I created a printhandler for the main Cells view ( overriding BreakFollowing,
- and DrawPageInterior ).
-
- In DrawPageInterior I first called INHERITED DrawPageInterior and then I call a
- method to print the row and column titles. The code for which goes something
- like this…
-
- { Get the currently focused page }
- theCurPage := PageToStrip ( fFocusedPage );
-
- { Print the column titles for the current page }
- thePageNum := fColPrintHandler.StripToPage ( 0, theCurPage.h );
- fColPrintHandler.SetPage ( thePageNum );
-
- { Now focus on the page and print it ( I can't rememeber why I changed
- gCurrPrintHandler here but I'll leave it since it works }
- tempPrintHandler := gCurrPrintHandler;
- gCurrPrintHandler := fColPrintHandler;
- IF fColPrintHandler.Focus THEN;
- fColPrintHandler.FocusOnInterior;
- fColPrintHandler.DrawPageInterior;
- gCurrPrintHandler := tempPrintHandler;
-
- ....
-
- { and now do the same for the row titles view, and that is all I did }
-
- All my overrides of BreakFollowing did was break on the last column and row
- that would fit on the page ( calculated by adding up the column widths and row
- heights ).
-
- Hope this helps you,
-
- Kevin Redden
- KPMG Peat Marwick
-
-